Hello,
pragma runLim,0
Module m = current
m = edit(fullName m, true)
if (null m){ack "{null} Parameter for current module!";halt;}
if (null current Module) {ack "Please run this program from a module";halt;}
else if (!isEdit current) {ack "current module must be editable to set permissions";halt;}
void inhertTable(Object o)
{
if (table o)
{
Object tbl= getTable (o)
inherited tbl
Object rowHead
for rowHead in table tbl do {inherited rowHead}
}
}
void main(Module m)
{
load view "Standard view"
Object o
for o in entire m do {
string err
err = set(o,read|write|change,null) // null means alter the
inherited o
inhertTable(o)
// default ACL record
if (!null err) {
ack "problem setting default ACL: " err
halt
}
}
}
/*************************************************
MAIN
*************************************************/
main(m)
save(m) // Saving...
close(m) // Closing...
SystemAdmin - Mon Aug 06 14:38:44 EDT 2012 |
Re: Turn off shareable-edit (help)
Hmm I guess:
pragma runLim,0
Module m = current
if (!isEdit m) m = edit(fullName m, true, true) // silent
if (null m){ack "Could not edit current module!";halt;}
Object o
for o in entire m do inherited o
save m
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Turn off shareable-edit (help) Mathias Mamsch - Mon Aug 06 16:22:17 EDT 2012
Hmm I guess:
pragma runLim,0
Module m = current
if (!isEdit m) m = edit(fullName m, true, true) // silent
if (null m){ack "Could not edit current module!";halt;}
Object o
for o in entire m do inherited o
save m
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
here is the original code but it didn't work on the tables; is it because the for loop wasn't using "entire"?
if (null current Module) {
ack "Please run this program from a module"
halt
} else if (!isEdit current) {
ack "current module must be editable to set permissions"
halt
}
Object o
string modName = (current Module)."Name" ""
for o in current Module do {
string err
err = set(o,read|write|change,null) // null means alter the
inherited o
// default ACL record
if (!null err) {
ack "problem setting default ACL: " err
halt
}
}
save current // save our work
|
Re: Turn off shareable-edit (help) SystemAdmin - Mon Aug 06 17:30:14 EDT 2012
here is the original code but it didn't work on the tables; is it because the for loop wasn't using "entire"?
if (null current Module) {
ack "Please run this program from a module"
halt
} else if (!isEdit current) {
ack "current module must be editable to set permissions"
halt
}
Object o
string modName = (current Module)."Name" ""
for o in current Module do {
string err
err = set(o,read|write|change,null) // null means alter the
inherited o
// default ACL record
if (!null err) {
ack "problem setting default ACL: " err
halt
}
}
save current // save our work
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Turn off shareable-edit (help) Mathias is right. The "for o in entire m do" loop grabs all objects. Not in this case, but generally you want to add:
The "for i in m do" loop respects the current display set. That puts the code at the mercy of the current view, which for me is unacceptable the vast majority of the time; thus I routinely use "entire". Your lines 6 and 7 should refer to "m" not "current". Swap lines 4 and 5. You don't need function inheritTable(). But if you did you don't need getTable() (o is already the table object), and you do need a "for oCell in rowHead do {inherited oCell}" statement -Louie |